Classic Command API
A command in Imperat is represented internally by the class dev.velix.imperat.command.Command which holds every command's data and needed usages.
Sub-commands at the other hand, are themselves Command
, simply there's no class called Subcommand or something like that, Subcommands are treated as commands and can be easily combined together in the form of a chain by merging the main-usage of a command to the subcommand's usage.
Moreover, A Command is also treated as a CommandParameter that can be added to a CommandUsage.
We will be learning every possible way of modifying the Command object you create (Classic) But first let's get to know the Mutable components of a command.
Every single Command object has the following mutable components :-
- Aliases (other names could be used for a command)
- Permission
- Description
- Default-usage (
/<command>
without any arguments ) - Usages
- Processors
Example
Here we will be creating our command builder instance :
var command = Command.<YourPlatformSource>createCommand("example");
Adding aliases
We want our command to have more than one identifiable name.
command.aliases("example2", "example3", "example4", "example5");